package cn.edu.scujcc;

import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AlbumService {
	@Autowired
	private AlbumRepository repo;
		
	public List<Album> getAllAlbum(){
		List<Album>result = null;
		result = repo.findAll();
		return result;
	}
	public Album getAlbum(String Album) {
		Album result = null;
		Optional<Album> op = repo.findById(Album);
		if (op.isPresent()) {
			result = op.get();
			}
		return result;
		}
}
